home *** CD-ROM | disk | FTP | other *** search
- ABOUT THESE COMPONENTS
-
- This component set was born because of the difficulty of coding
- generic cut copy and paste routines that work with dbGrids
- stringGrids and even dbImages. Especially in Delphi 1.0.
- It also fixes the bug in 1.0 dbImages that causes a GPF if you
- try to cut an image to the clipboard when the Stretch property is true.
-
- ====================================
-
- TcwClpBoardButton
-
- ====================================
-
- The TcwClpBoardButton encapsulates all the necessary code
- for Cutting, copying or pasting within its click method. No code
- needed!
-
- New Method
- setEnabledState
-
- It has a 'setEnabledState' method that with just a couple
- of lines of code makes their Enabled state Data Aware.
- See the Demo code for the "onIdle" event.
-
- New property
-
- Kind
-
- Kind has 3 values
- bkCut - The default
- bkCopy
- bkPaste
-
- Setting this property is all you have to do to turn it into the
- appropriate type of button including setting the correct
- BITMAP and HINT.
-
- ==================================
-
- TcwClpBoardBar
-
- ==================================
-
- This is a descendant of TcwToolBar (See Below)
- It is a TcwToolBar with three cwClpBoardButtons encapsulated
- as Cut Copy and Paste buttons.
-
- Using this composite component will ensure a conforming
- appearance across all forms without needing precise GUI
- manipulation.
-
- It inherits all the neat features of the TcwToolBar and by
- increasing its width you can add additional buttons that
- will also be manipulated as in the TcwToolBar.
-
- New Method
-
- setEnabledState
-
- This method controls the setEnabledState of all 3 encapsulated
- TcwClpBoardButtons.
-
-
- ===================================
-
- TcwToolBar
-
- ===================================
-
- This is a descendent ot TPanel that knows how to:-
-
- 1. Resize any components it contains when IT is resized. You can
- also use this ability to make sure all components dropped onto
- the toolBar are the correct height and precisely aligned.
-
- By dropping bevel components onto the toolbar and setting
- their visible property to FALSE you can create spacers to
- seperate different logical groups of buttons.
-
- It uses the values of 2 new properties
-
- AutoSizeButtons - Turn on/Off autoSizing
-
- KeepSquare - Turn on/Off keeping buttons square when
- autoSized
-
- 2. Set its orientation to Horizontal or Vertical through a new
- Property
-
- Orientation
- Values
- toHorizontal
- toVertical.
-
- When the Orientation is changed the component knows how
- to reset any components it contains to a horizontal set or a
- vertical set.
- NOTE : Components that are not approximately square may be
- truncated if orientation is changed. (e.g. Drop down combo)
-
- 3. Dock itself to Top, Left, Top, Bottom or None.
- It automatically takes care of reAligning any buttons it contains
- appropriately.
-
- Property
-
- Dock
- Values
- tdTop
- tdLeft
- tdBottom
- tdRight
- tdNone - Default
-
- ===========================
-
- HINTS ON USE
-
- TcwClpBoardButton
-
- Use it as a non visual object (Visible = False) to easily enable
- Menu items with one line of code.
-
- 1. give the button a descriptive name e.g. butCut
- 2. In the Menu event handler use butCut.Click;
-
- If you set the menu item shortCut key to Ctrl-X you will
- get the added benefit of having the component code
- respond instead of windows native behaviour. This
- avoids the dbImage cutToClipboard GPF problem.
-
- You can also handle Shift-Delete but that has to be done
- on each dbImage component in the KeyDown event
-
- procedure
- TForm1.DBImage1KeyDown(Sender:
- TObject; var Key: Word; Shift: TShiftState);
- begin
- if (shift = [ssShift]) and ( Key = VK_Delete) then begin
- Key := 0; {Prevent windows from seeing it}
- butCut.Click;
- end;
- end;
-
- ============================
- Additional Files
-
- TBAR.RES contains the bitMaps for the 3 buttons.
-
- TBAR1.DCR contains the icons for the components.
-
- ==============================
-
- Known Problems
-
- 1. Does not support all 3 rd Party Grids. Contact us for specific
- information and additional modules with alternate code.
-